API Documentation
Public Member Functions | List of all members
nkAstraeus::Material Class Referenceabstract

Base class for all materials in the component. More...

Inheritance diagram for nkAstraeus::Material:
nkAstraeus::PbsMaterial

Public Member Functions

 Material ()
 
virtual ~Material ()
 
nkMemory::StringView getName () const
 
nkGraphics::ShadergetShader () const
 
virtual MATERIAL_TYPE getType () const =0
 
void setName (const nkMemory::StringView &value)
 
virtual bool load ()=0
 
virtual void unload ()=0
 

Detailed Description

Base class for all materials in the component.

This class offers basic information and the general interface to access them. Materials are designed to be inter-operable with the nkGraphics::Entity class. As such, the shader created by a material is usable directly on an entity.

Constructor & Destructor Documentation

◆ Material()

nkAstraeus::Material::Material ( )

Constructor.

◆ ~Material()

virtual nkAstraeus::Material::~Material ( )
virtual

Destructor.

Member Function Documentation

◆ getName()

nkMemory::StringView nkAstraeus::Material::getName ( ) const
Returns
The material's name.

◆ getShader()

nkGraphics::Shader* nkAstraeus::Material::getShader ( ) const
Returns
The final shader prepared by the material, once a successful load() has been called.

◆ getType()

virtual MATERIAL_TYPE nkAstraeus::Material::getType ( ) const
pure virtual
Returns
The material real type. Allows to know which derived class this material truly is.

Implemented in nkAstraeus::PbsMaterial.

◆ setName()

void nkAstraeus::Material::setName ( const nkMemory::StringView value)

Sets the name of the material.

Parameters
valueThe name to set.
Remarks
This function is called by the MaterialManager to keep it in sync with its internal memory. If you need to alter this, please call MaterialManager::rename.

◆ load()

virtual bool nkAstraeus::Material::load ( )
pure virtual

Loads the material and make it ready for rendering.

Returns
Whether the loading went well (true) or not (false).

Implemented in nkAstraeus::PbsMaterial.

◆ unload()

virtual void nkAstraeus::Material::unload ( )
pure virtual

Unloads the material and its internal memory. After that, the material is unusable for rendering.

Implemented in nkAstraeus::PbsMaterial.


The documentation for this class was generated from the following file: